<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>宠物商城</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">宠物商城</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-label="切换导航">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link active" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#" id="categoriesLink">商品分类</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/cart.html">购物车</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/orders.html">我的订单</a>
                    </li>
                </ul>
                <div class="d-flex">
                    <div class="input-group me-3">
                        <input type="text" class="form-control" placeholder="搜索商品" id="searchInput">
                        <button class="btn btn-outline-light" type="button" onclick="searchProducts()">搜索</button>
                    </div>
                    <div id="userActions">
                        <a href="/login.html" class="btn btn-outline-light me-2">登录</a>
                        <a href="/register.html" class="btn btn-primary">注册</a>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <!-- 商品分类侧边栏 -->
    <div class="container mt-4">
        <div class="row">
            <div class="col-md-3">
                <div class="card">
                    <div class="card-header">
                        <h5 class="mb-0">商品分类</h5>
                    </div>
                    <div class="list-group list-group-flush" id="categoryList">
                        <!-- 分类列表将通过JavaScript动态加载 -->
                    </div>
                </div>
                <div class="card mt-3">
                    <div class="card-header">
                        <h5 class="mb-0">价格筛选</h5>
                    </div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label class="form-label">最低价格</label>
                            <input type="number" class="form-control" id="minPrice" placeholder="请输入最低价格">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">最高价格</label>
                            <input type="number" class="form-control" id="maxPrice" placeholder="请输入最高价格">
                        </div>
                        <button class="btn btn-primary w-100" onclick="filterByPrice()">筛选</button>
                    </div>
                </div>
            </div>

            <!-- 商品列表 -->
            <div class="col-md-9">
                <div class="row" id="productList">
                    <!-- 商品列表将通过JavaScript动态加载 -->
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="bg-dark text-white mt-5 py-3">
        <div class="container text-center">
            <p>&copy; 2024 宠物商城. All rights reserved.</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="js/main.js"></script>
</body>
</html> 